package com.gitee.wsl.platform


/**
 * Timeout in seconds to wait for the composition to be resumed after the Activity/Fragment is resumed.
 * This is only applicable to Android.
 */
const val COMPOSITION_RESUMED_TIMEOUT_IN_SECONDS: Long = 1

/**
 * This class allows a specific platform to handle the lifecycle of objects stored in [ScopedViewModelContainer].
 * For example, in Android, this class is used to wait for the first frame after Activity resumes and properly handle changes after configuration changes.
 */
expect class PlatformLifecycleHandler() {
     fun onResumed()
     fun onDestroyed()
     suspend fun awaitBeforeDisposing(inForeground: Boolean)
}


class DefaultPlatformLifecycleHandler() {
     fun onResumed() {}
     fun onDestroyed() {}
     suspend fun awaitBeforeDisposing(inForeground: Boolean) {}
}